package com.founder.android.reader.adapter;

import java.util.List;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.founder.android.reader.R;
import com.founder.android.reader.bookview.AbsAdapter;


public class BookAdapter<T> extends AbsAdapter<String>{
	
	private Context mContext;
	public BookAdapter(Context context) {
		super();
		this.mContext = context;
	}
	public void addItem(List<String> list){
		super.list.addAll(list);
	}
	public int getCount() {
		return super.list.size();
	}

	public String getItem(int position) {
		return super.list.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position) {
		TextView textView = new TextView(mContext);
		textView.setText(super.list.get(position));
		textView.setTextColor(Color.BLACK);
		textView.setBackgroundColor(Color.WHITE);
		textView.setBackgroundResource(R.drawable.ly);
		textView.setPadding(10, 10, 10, 10);
		textView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
		return textView;
	}
	

}
